/*#include<stdio.h>
int fac(int a, int n) {
	int product = 1;
	for (int i = 0; i < n; i++) {
		product *= a;
	}
	return product;
}
int judge_digit(int a, int n) {
	if (a == 0 || a == 1) {
		return 0;
	}
	if (fac(2, n - 1) <= a && a < fac(2, n)) {
		return n - 1;
	} else {
		return judge_digit( a, n - 1);
	}
}
int judge_1_digit(int a, int n, int count) {
	if (n == 0) {
		if (a == 1) {
			count++;
			return count;
		}
		if (a == 0) {
			return count;
		}
	} else {
		if (a >= fac(2, n)) {
			count++;
			return judge_1_digit(a - fac(2, n), n - 1, count);
		} else {
			return judge_1_digit( a, n - 1, count);
		}
	}
}
int main() {
	int a = 0;
	scanf("%d", &a);
	int n = judge_digit( a, 8 );
	int count = 0;
	n = judge_1_digit( a, n, count );
	printf("%d", n);
	return 0;
}*/
//得一个数二进制下1的位数最经典的方法
#include<stdio.h>
int find_1_count( int n) {
	int count = 0;
	while (n) {
		n = n&(n - 1);     //每次可以把n的二进制最右边的1去掉
		count++;
	}
	return count;
}
int main() {
	int n = 0;
	scanf("%d", &n);
	n = find_1_count(n);
	printf("%d", n);
}
